package com.dhl.mediator.smarthouse;

import com.dhl.mediator.Mediator;

/**
 * @title: CoffeeMachine
 * @Author danghailiang
 * @Date: 2022/8/22 10:44
 * @Version 1.0
 */
public class CoffeeMachine  extends Colleague{

    public CoffeeMachine(String name, Mediator mediator) {
        super(name, mediator);
        // 自我注册
        mediator.register(super.name,this);
    }

    @Override
    protected void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange, this.name);
    }


    public void startCoffee() {
        System.out.println("咖啡机开始煮咖啡");
    }

}
